<template>
  <div>
    <div class="footer_wrap">
      <!-- <a href="#/find">发现音乐</a>
      <a href="#/my">我的音乐</a> -->
      <!-- /path?参数名=值 -->
      <!-- <a href="#/part?username=hell">朋友</a> -->
      <!-- /path/:id – 需要路由对象提前配置 path: “/path/参数名” -->
      <!-- <router-link to="/part/hellwoll">朋友</router-link> -->


      <span @click="fn('/find')">发现音乐</span>
      <span @click="fn('/my')">我的音乐</span>
      <span @click="fn('/part')">朋友</span>

      <span @click="fn1('/part','part')">朋友 --query</span>
      <span @click="fn2('/part','part')">朋友--params</span>
    </div>
    <div class="top">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  methods:{
    fn(path){
      this.$router.push({path},()=>{})
    },
    fn1(path,name){
      this.$router.push({
        name,
        query:{
          username:'hell',
          password:'123'
        }
      },()=>{})
    },
    fn2(path,name){
      this.$router.push({
        name,
        params:{
          username:'ikun',
          password:'123456'
        }
      },()=>{})
    },
  },
};
</script>

<style scoped>
.footer_wrap {
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  width: 100%;
  text-align: center;
  background-color: #333;
  color: #ccc;
}
.footer_wrap span{
  flex: 1;
  text-decoration: none;
  padding: 20px 0;
  line-height: 20px;
  background-color: #333;
  color: #ccc;
  border: 1px solid black;
}
.footer_wrap span:hover {
  background-color: #555;
}
.top {
  padding-top: 62px;
}
</style>